<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<!doctype html>
<html>
<head>
	<meta charset="utf-8" />
		<title>添加微帖</title>
		<link rel="stylesheet" type="text/css" href="css/index.css" />
	<link rel="stylesheet" href="themes/default/default.css" />
	<link rel="stylesheet" href="js/plugins/code/prettify.css" />
	<script charset="utf-8" src="js/kindeditor.js"></script>
	<script charset="utf-8" src="js/zh_CN.js"></script>
	<script charset="utf-8" src="js/plugins/code/prettify.js"></script>
	<script charset="utf-8" src="js/jquery.js"></script>
	<link rel="stylesheet" href="js/default.css" />
	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content1"]', {
				cssPath : '../js/plugins/code/prettify.css',
				uploadJson : 'upload.action',
				fileManagerJson : 'jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
</head>
<body>
	<input type="hidden" value="<%=htmlData%>">
	<form name="example" method="post" action="doTribune!saveTribune.action">
	<table class="form-table" cellspacing="0" cellpadding="0">
			<colgroup>
				<col style="width: 17%" />
				<col style="width: 83%" />
			</colgroup>
			<tr>
				<td class="bt-xx" colspan="2">
					<img src="images/titlebar_icon.gif" />
					&nbsp;添加微帖
				</td>
			</tr>
			<tr>
				<th>
					发帖用户ID：
				</th>
				<td>
					<input type="text" class="inputstyle" name="userId"/>
				</td>
			</tr>
			<tr>
				<th>
					发帖用户名：
				</th>
				<td>
					<input type="text" class="inputstyle" name="userNames"/>
				</td>
			</tr>
			<tr>
				<th>
					微帖标题：
				</th>
				<td>
					<input type="text" class="inputstyle" name="tname"/>
				</td>
			</tr>
			<tr>
				<th>
					微帖类型类型：
				</th>
				<td>
					<input type="text" class="inputstyle"  name="tritype" />(1二手换购 2.人气美食 3.促销打折 4.新店开张 5.免费试吃6.人们活动7.周边游记8.吐槽专区)
				</td>
			</tr>
		<tr>
				<th>
					发帖内容：
				</th>
				<td>
		<textarea name="content1" id="mutou" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;"><%=htmlspecialchars(htmlData)%></textarea>
		</td>
		</tr>
			<tr>
				<th>
					被赞数：
				</th>
				<td>
					<input type="text" class="inputstyle2" name="tgood"/>
				</td>
			</tr>
			<tr>
				<th>
					被鄙视数：
				</th>
				<td>
					<input type="text" class="inputstyle2" name="tbad"/>
				</td>
			</tr>
			<tr>
				<th></th>
				<td>
					<input type="submit"  class="buttonstyle" name="button" value="提交" />
				</td>
			</tr>
		</table>
	</form>
		
</body>
</html>
<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>